﻿@model Catalog
@{
    Layout = "~/Views/Shared/LS/_Layout2.cshtml";
    var catalog = Model;
    var parentCatalog = catalog.Parent;
    var key = catalog.Key;

    if (parentCatalog != null && parentCatalog.Key != "Product")
    {
        parentCatalog = null;
    }

    if (parentCatalog != null)
    {
        key = parentCatalog.Key;
    }

    ViewBag.Nav = key;
    ViewBag.Title = catalog.Name;
}
@Html.Partial("_DetailFor" + key)

@*<h3 class="title">@Model.Name</h3>
    @if (key == "About" || key == "Contacts")
    {
        var article = Model.Articles.FirstOrDefault();
        <div class="boxDetail">
            <h1>@Html.Raw(article.Title)</h1>
            <div class="date"> </div>
            <div class="html">
                @if (!string.IsNullOrEmpty(article.TitleImageUrl))
                {
                    <img src="@article.TitleImageUrl" style="margin:0 auto;max-width:600px;display:block" />
                }
                @if (article.ArticleTexts.Count > 0)
                {
                    @Html.Raw(article.ArticleTexts[0].Text)
                }
                <div class="clear"></div>
            </div>
        </div>
    }
    else if (key == "Product")
    {
        <div class="boxImages">
            @Html.Action("ReadForCatalog", "Articles", new { PageSize = 12, VPartial = "ReadForIndex2", CatalogKey = Model.Key, IncludeChild = true })
        </div>
    }
    else
    {
        <div class="boxList">
            @Html.Action("ReadForCatalog", "Articles", new { PageSize = 20, VPartial = "ReadForIndex", CatalogKey = Model.Key, IncludeChild = true })
        </div>
    }*@



